package com.hmy.cornpestdet.controller;

import com.hmy.cornpestdet.service.UserDataAnalyzeService;
import com.hmy.cornpestdet.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user/analyze")
public class UserDataAnalyzeController {
    @Autowired
    UserDataAnalyzeService userDataAnalyzeService;

    @GetMapping("/getAllRiceDataByUid")
    public Result getAllRiceDataByUid(){
        return userDataAnalyzeService.getAllRiceDataByUid();
    }

    @GetMapping("/getAllUploadCountByUid")
    public Result getAllUploadCountByUid(){
        return userDataAnalyzeService.getAllUploadCountByUid();
    }


    @GetMapping("/getAllMonthRiceDataByUid")
    public Result getAllMonthRiceDataByUid(){
        return userDataAnalyzeService.getAllMonthRiceDataByUid();
    }

    @GetMapping("/getSingleMonthRiceDataByUid")
    public Result getSingleMonthRiceDataByUid(@RequestParam int month){
        return userDataAnalyzeService.getSingleMonthRiceDataByUid(month);
    }

}
